package com.linghang.lhonline.Util;

import com.linghang.lhonline.VO.ResultVO;

public class ResultVOUtil {

    public static ResultVO success(String message, Object object){
        ResultVO resultVO = new ResultVO();

        resultVO.setCode(0);
        resultVO.setMessage(message);
        resultVO.setData(object);

        return resultVO;
    }

    public static ResultVO success(String message){
        ResultVO resultVO = new ResultVO();

        resultVO.setCode(0);
        resultVO.setMessage(message);

        return resultVO;
    }

    public static ResultVO error(String message){
        ResultVO resultVO = new ResultVO();

        resultVO.setCode(1);
        resultVO.setMessage(message);

        return resultVO;
    }

    public static ResultVO warning(String message, Object object){
        ResultVO resultVO = new ResultVO();

        resultVO.setCode(2);
        resultVO.setMessage(message);
        resultVO.setData(object);

        return resultVO;
    }
}
